package com.chat.view;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;

import java.io.File;

/*
    自己发图片的Controller
 */
public class ChatRightImageController {

    public ImageView touxiang;
    public ImageView content;
    public Text nickname;
    public String id;
    public Text time;

    public void setTime(String time) {
        this.time.setText(time);
    }

    public void setTouxiang(String username) {
        File file1=new File("D:/chatproject/client/"+username+".png");
        this.touxiang.setImage(new Image("file:"+file1.getAbsolutePath()));
    }

    public void setContent(String filename) {
        File file1=new File("D:/chatproject/client/"+filename+"");
        this.content.setImage(new Image("file:"+file1.getAbsolutePath()));
    }

    public void setNickname(String nickname) {
        this.nickname.setText(nickname);
    }
    public void setId(String id) {
        this.id = id;
    }

}
